<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		{% load static %}
		{% load news_filter%}
		<link rel="stylesheet" type="text/css" href="{% static 'news/css/article_detail.css' %}"/>
	</head>
	<body>

		<div id="head"  style="width:1692px; height:72px; background:black; position:relative;">
			 <div style="position: absolute; left: 155px; top: 20px;">
                <img src="{% static 'news/images/logo.png' %}">
            </div>
			{% if user %}
				<div id="head_1" style="top:20px;"><a href="{% url 'news:publish_content' %}" style="color:white;">发布内容</a></div>
				<a href="{% url 'news:user_index' %}"><img src="{% static user.portrait_url %}" id="head_2" style="position: relative; top:30px; right:-1220px; border-radius: 50%;"></a>
				{% else %}
				<p id="head_0"><a href="{% url 'news:user_login' %}" id="a1">登录 |</a>
				<a href="{% url 'news:user_register' %}" id="a2">注册</a></p>
			{% endif %}
		</div>

		<div id="body_1">
			<ul>
				<li><strong>新闻-新闻详情</strong></li>
			</ul>
		</div>

		<div id="body_2" style="">                                                         
			<img src="{% static 'news/images/xcx.png' %}" alt="" id="xcx">
			<span id="xcx_1" style="position: relative; top:20px;"><strong>扫码小程序</strong></span>
			<span id="hand" style="position: relative;  top:50px;">掌上轻松阅读>></span>
		</div>

		<div id="body_4">
			<div id="body_4_1"><h2>{{article.title}}</h2></div>
			<p><span id="neck">{{user.nickname}} | <span>{{article.pub_date|date:'Y-m-d H:i:s'}}</span></span>
			<span id="fen">
			<img src="{% static 'news/images/k_02.png'%}" alt="">{{article.share_number}}</span>
			<span id="look"><img src="{% static 'news/images/yan.png' %}" alt="" ><span>{{article.view_number}}</span>
			</span></p>
			<p id="heng"></p>
			<p id="center">{{article.abstract}}</p>
			<div id="content"></div>
			<div id="comments">
				{{article.abstract|safe}}

				<div id="source">本文来源：{{article.source}}文章作者：{{article.author.nickname}}</div>

				<div id="goods"><a id="likes" ><img src="{% static 'news/images/good_n.png'%}" id="zan"><span id="like">{{article.like_number}}</span></a><a href="{% url 'news:share' article.id %}"><img src="{% static 'news/images/fx_s.png'%}" id="fx"><span id="fxd">分享到</span></a></div>
				<ul style="position: relative; top:160px; left:50px;">
					{% for com in comments %}
					<li>{{com.content}}</li>
					{% endfor %}
				</ul>
				<form action="{% url 'news:comment' article.id %}" method="post" style="position: relative; top:180px; left:50px;">
					{% csrf_token %}
					<input type="text" name="content">
					<input type="submit" value="发送"/>
				</form>
			</div>
			<div id="statement" style="position: relative; top:120px; left:50px;">声明：本文由入驻{{article.author.nickname}}的作者撰写，观点仅代表作者本人，绝不代表可牛赞同其观点或证实其描述。</div>

		</div>


</section>
		<div id="body_3">
			<strong id="remen">热门新闻</strong>
			<img src="{% static article.images.url %}" alt="" id="img3">
			<div id="titles">{{article.title}}</div>
			{% for i in l_news%}
			<a class="news_2" href="{% url 'news:article_detail' i.id %}">
				<img src="{% static i.images.url %}" class="img3">
				<span class="titles">{{i.title}}</span>
				<span class="times">{{i.pub_date|date:'Y-m-d'}}</span>
			</a>
			{% endfor %}
		</div>
	</body>
	<script type="text/javascript" src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){

			{% if likes %}
				$('#zan')[0].src = '{% static 'news/images/good_s.png' %}'
			{% endif %}

			$('#likes').click(function(){
				{% if likes %}
					alert('您已经赞过了')
					return false;
				{% else %}
					$.ajax({url:"{% url 'news:zan' article.id %}",async:false});
					$('#like').html({{article.like_number}}+1)
					$('#zan')[0].src = '{% static 'news/images/good_s.png' %}'
				{% endif %}
			})
		})
	</script>

</html>